<?php
namespace app\index\controller;

use app\BaseController;
class Poisonous extends BaseController
{
    public function poisonousText(){
        $url = 'https://api.oick.cn/dutang/api.php';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "$url");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        // 禁用SSL证书验证，不推荐
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        // 如果你有CA证书的自定义路径，可以这样设置
        // curl_setopt($ch, CURLOPT_CAINFO, '/path/to/ca.pem');
        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            echo 'Curl error: ' . curl_error($ch);
        }
        curl_close($ch);

        return json($result, 200);


    }
}